package cn.dbqn.controller;

import cn.dbqn.entity.Chickmarket;
import cn.dbqn.service.ChickmarketService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class ChickmarketController {
    @Resource
    ChickmarketService chickmarketService;

    @RequestMapping("/listrjxs")
    public String list(Model model){
        List<Chickmarket> list=chickmarketService.findAllRjxs();
        model.addAttribute("list",list);
        return "lyear_pages_add_doc";
    }

    @ResponseBody
    @RequestMapping("rjxs")
    public Object rjxs(@RequestParam("chickmarketNo")Integer chickmarketNo){
        Chickmarket rjxs=chickmarketService.rjxs(chickmarketNo);
        return rjxs;
    }
}
